home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / arts / objectmanager.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-09-10  |  1.9 KB  |  76 lines

  1.     /*
  2.  
  3.     Copyright (C) 2000 Stefan Westerfeld
  4.                        stefan@space.twc.de
  5.  
  6.     This library is free software; you can redistribute it and/or
  7.     modify it under the terms of the GNU Library General Public
  8.     License as published by the Free Software Foundation; either
  9.     version 2 of the License, or (at your option) any later version.
  10.   
  11.     This library is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.     Library General Public License for more details.
  15.    
  16.     You should have received a copy of the GNU Library General Public License
  17.     along with this library; see the file COPYING.LIB.  If not, write to
  18.     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.     Boston, MA 02111-1307, USA.
  20.  
  21.     */
  22.  
  23. #ifndef OBJECTMANAGER_H
  24. #define OBJECTMANAGER_H
  25.  
  26. #include "object.h"
  27. #include "factory.h"
  28. #include <list>
  29.  
  30. #include "arts_export.h"
  31.  
  32. /*
  33.  * BC - Status (2002-03-08): ObjectManager
  34.  *
  35.  * Keep binary compatible (since accessible via ::the()), use d ptr when
  36.  * changing it.
  37.  */
  38.  
  39. namespace Arts {
  40.  
  41. class Object;
  42. class ObjectManagerPrivate;
  43.  
  44. class ARTS_EXPORT ObjectManager {
  45. private:
  46.     ObjectManagerPrivate *d;
  47.  
  48. protected:
  49.     static ObjectManager *_instance;
  50.     std::list<Factory *> factories;
  51.     std::list<std::string> referenceNames;
  52.  
  53. public:
  54.     ObjectManager();
  55.     ~ObjectManager();
  56.  
  57.     static ObjectManager *the();
  58.     Object_skel *create(const std::string& name);
  59.  
  60.     bool addGlobalReference(Object object, const std::string& name);
  61.     std::string getGlobalReference(const std::string& name);
  62.     void removeGlobalReferences();
  63.     void removeExtensions();
  64.     void shutdownExtensions();
  65.  
  66.     void registerFactory(Factory *factory);
  67.     void removeFactory(Factory *factory);
  68.  
  69.     void provideCapability(const std::string& capability);
  70.     void removeCapability(const std::string& capability);
  71. };
  72.  
  73. }
  74.  
  75. #endif /* OBJECTMANAGER_H */
  76.